<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="UTF-8" import="java.text.SimpleDateFormat"
	import="java.util.Date" import="java.util.List"
	import="xyz.xiangyushui.javaBean.salesPlan.DailyPlan"
	import="xyz.xiangyushui.javaBean.salesPlan.DailyPlanCommodity"%>
<%@include file="/lib/common/basedir.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
<%@include file="/lib/common/headerResource.html"%>

<!--sidebar-->
<link href="<%=basedir%>/lib/css/sidebar.css" rel="stylesheet">




<title>DessertHouse</title>

<style>
.date {
	margin-top: 1.3em;
}

.activity-detail {
	font-size: 1.5em;
	margin-bottom: 1.2em;
}

.item {
	margin-right: 1.5em;
}

.choice {
	margin-top: 2em;
}
</style>

</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<!--左侧导航-->
			<div class="col-sm-3 col-md-2 sidebar">
				<%@include file="../sidebar.jsp"%>
			</div>

			<!--右面板-->
			<div
				class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 rightPanel">
				<div class="row">
					<h2 class="page-header col-md-11">审批销售计划</h2>
				</div>

				<div class="row col-md-9">
					<%
						DailyPlan plan=(DailyPlan)request.getAttribute("dailyPlan");
																		long date=plan.getDate();
																		int storeId=plan.getStoreId();
					%>


					<p class="activity-detail date">
						日期：<%=new SimpleDateFormat("yyyy-mm-dd").format(new Date(date)) %></p>

					<p class="activity-detail">
						店铺：<%=storeId%></p>

					<%
						List<DailyPlanCommodity> comms=plan.getCommodity();
									for(DailyPlanCommodity c:comms){
					%>

					<p class="activity-detail">
						<span class="item">商品：<%=c.getCommodityIdName() %></span> <span class="item">数量：<%=c.getNum() %></span>
						<span class="item">价格：<%=c.getPrice() %></span>
					</p>
					
					<%
						}
					%>

				</div>

				<div class="row col-md-9 choice">
					<div class="col-md-2 col-md-offset-4">
						<button type="button" class="btn btn-primary btn-block col-md-2"
							onclick="document.location='<%=basedir%>/manager/salesPlan/approve?id=<%=date+"_"+storeId %>';">通过</button>
					</div>
					<div class="col-md-2 ">
						<button type="button" class="btn btn-default  btn-block col-md-2"
							onclick="document.location='<%=basedir%>/manager/salesPlan/reject?id=<%=date+"_"+storeId %>';">退回</button>
					</div>
				</div>

			</div>
		</div>
	</div>


	<!-- jquery and bootstrap js -->
	<%@include file="/lib/common/footerResource.html"%>

	<script>
		$(function() {
			$("[data-toggle='tooltip']").tooltip();
		});
	</script>
</body>
</html>